<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2020/12/16
 * Time: 11:21
 */

namespace Multiple\Home\Controllers;
use Asa\Erp\TbMember;
use Asa\Erp\TbMemberAddress;
use Asa\Erp\TbUser;
use Phalcon\Paginator\Adapter\Model;
class MemberaddressController extends AdminController{

    private $model;
    /**
     * 初始化
     */
    public function initialize()
    {
        parent::initialize();
        $this->model = new TbMemberAddress();
        $this->setModelName('Asa\\Erp\\TbMemberAddress');
    }


    //获取会员地址信息
    public function getAddressListAction(){
        $where = [];
        if(isset($_POST["member_id"]) && trim($_POST["member_id"]) != ""){
            $where = [
                sprintf("member_id=%d", $_POST['member_id']),
                "order" => "id DESC",
            ];
        }
        $result = TbMemberAddress::find($where);
        echo $this->success($result);
    }
}